<template>
  <div id="search-goods">
    <van-card
      v-for="(item,index) in goodsList"
      :key="index"
      :title="item.goods_name"
      :thumb="item.goods_small_logo"
      @click="goodsItemClick(item.goods_id)"
    >
      <p slot="price" style="color:red">￥{{item.goods_price.toFixed(2)}}</p>
    </van-card>
  </div>
</template>

<script>
import Vue from 'vue';
import { Card } from 'vant';
import 'vant/lib/card/style'
Vue.use(Card);
export default {
  name:"SearchGoods",
  props:{
    goodsList:Array
  },
  methods:{
    goodsItemClick(id){
      this.$emit("getGoodsId",id)
    }
  }
}
</script>

<style scoped>
  #search-goods{
    height: calc(100vh - 60px - 54px);
    overflow: auto;
  }
</style>